﻿using Business.BorrowManagement.Dto;
using Business.BorrowManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Business.InvenManagement;
using Business.InvenManagement.Dto;

namespace Business.Controllers
{

    [RemoteService]
    [Area("Business")]
    [Route("api/business/invenk")]
    public class InvenController : AbpController
    {
        private readonly IInvenAppService _InvenkAppService;

        public InvenController(IInvenAppService InvenAppService)
        {
            _InvenkAppService = InvenAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<InvenDto> CreateOrUpdate(InvenDto input)
        {
            return _InvenkAppService.CreateOrUpdate(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _InvenkAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<InvenDto> Get(Guid id)
        {
            return _InvenkAppService.Get(id);
        }

        [HttpGet]
        public Task<PagedResultDto<InvenDto>> GetAll(GetInvenInputDto input)
        {
            return _InvenkAppService.GetAll(input);
        }

    }
}
